<?php


namespace partner\functions\wechat\lib\SaleInfo;

use partner\functions\wechat\lib\BaseWechatPartner;
use Exception;

class BizStoreInfo extends BaseWechatPartner
{
    protected $upload_properties = [
        'indoor_pic' => 9999,
        'store_entrance_pic' => 9999
    ];

    // 线下场所名称
    public $biz_store_name = '';

    // 线下场所省市编码
    public $biz_address_code = '';

    // 线下场所地址
    public $biz_store_address = '';

    // 线下场所门头照片
    public $store_entrance_pic = [];

    // 线下场所内部照片
    public $indoor_pic = [];

    // 线下场所对应的商家AppID
    public $biz_sub_appid = '';

    public function setBizStoreName(string $biz_store_name = '')
    {
        if (empty($biz_store_name))
            throw new Exception("线下场所名称不能为空");

        $this->biz_store_name = $biz_store_name;
        return $this;
    }

    public function setBizAddressCode(string $biz_address_code = '')
    {
        if (empty($biz_address_code))
            throw new Exception("线下场所省市编码不能为空");

        $this->biz_address_code = $biz_address_code;
        return $this;
    }

    public function setBizStoreAddress(string $biz_store_address = '') 
    {
        if (empty($biz_store_address))
            throw new Exception("线下场所地址不能为空");

        $this->biz_store_address = $biz_store_address;
        return $this;
    }

    public function setStoreEntrancePic(array $store_entrance_pic = []) 
    {
        if (empty($store_entrance_pic))
            throw new Exception("线下场所门头照片不能为空");

        $this->store_entrance_pic = $store_entrance_pic;
        return $this;
    }

    public function setIndoorPic(array $indoor_pic = []) 
    {
        if (empty($indoor_pic))
            throw new Exception("线下场所内部照片不能为空");

        $this->indoor_pic = $indoor_pic;
        return $this;
    }

    public function setBizSubAppId(string $biz_sub_appid = '')
    {
        $this->biz_sub_appid = $biz_sub_appid;
        return $this;
    }
}